//
//  YMScannerView.h
//  QrCode
//
//  Created by Andrew on 2018/6/22.
//  Copyright © 2018年 Andrew. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "YMQRCode.h"

@interface YMScannerView : UIView

- (instancetype)initWithFrame:(CGRect)frame config:(YMQRCodeConfig *)config;

/** 添加扫描线条动画 */
- (void)ym_addSacnnerLineAnimation;

/** 暂停扫描线条动画 */
- (void)ym_pauseScannerLineAnimation;

/** 添加指示器 */
- (void)ym_addActivityIndicator;

/** 移除指示器 */
- (void)ym_removeActivityIndicator;

- (CGFloat)scanner_x;
- (CGFloat)scanner_y;
- (CGFloat)scanner_width;


/**
 显示手电筒

 @param animated 是否附带动画
 */
- (void)ym_showFlashlightWithAnimated:(BOOL)animated;

/**
 隐藏手电筒

 @param animated 是否附带动画
 */
- (void)ym_hideFlashlightWithAnimated:(BOOL)animated;


/**
 设置手电筒开关

 @param on YES:开 NO:关
 */
- (void)ym_setFlashlightOn:(BOOL)on;


/**
 获取手电筒当前开关状态

 @return YES:开 NO:关
 */
- (BOOL)ym_flashlightOn;

@end
